package com.megvii.koala.data.comparetor;

import com.megvii.koala.data.bean.CreatureBean;

import java.util.Comparator;

/**
 * @author xiaanming
 */
public class PinyinComparator<T extends CreatureBean> implements Comparator<T>
{
    public int compare(T o1, T o2)
    {
        if (o1.zimuName.equals("@") || o2.zimuName.equals("#"))
        {
            return 1;
        }
        else if (o1.zimuName.equals("#") || o2.zimuName.equals("@"))
        {
            return -1;// 排到前面
        }
        else
        {
            return o1.zimuName.compareTo(o2.zimuName);
        }
    }

}
